<?php

namespace UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;

/**
 * User
 *
 * @ORM\Table(name="user")
 * @ORM\Entity(repositoryClass="UserBundle\Repository\UserRepository")
 */
class User extends BaseUser
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="api_token", type="string", length=255, nullable=true, unique=true)
     */
    private $apiToken;

    /**
     * @ORM\OneToMany(targetEntity="AccountBundle\Entity\Category", mappedBy="user")
     */
    private $bill_categories;


    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set apiToken
     *
     * @param string $apiToken
     *
     * @return User
     */
    public function setApiToken($apiToken)
    {
        $this->apiToken = $apiToken;

        return $this;
    }

    /**
     * Get apiToken
     *
     * @return string
     */
    public function getApiToken()
    {
        return $this->apiToken;
    }

    /**
     * Add billCategory
     *
     * @param \AccountBundle\Entity\Category $billCategory
     *
     * @return User
     */
    public function addBillCategory(\AccountBundle\Entity\Category $billCategory)
    {
        $this->bill_categories[] = $billCategory;

        return $this;
    }

    /**
     * Remove billCategory
     *
     * @param \AccountBundle\Entity\Category $billCategory
     */
    public function removeBillCategory(\AccountBundle\Entity\Category $billCategory)
    {
        $this->bill_categories->removeElement($billCategory);
    }

    /**
     * Get billCategories
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillCategories()
    {
        return $this->bill_categories;
    }
}
